/**
 * 装饰器版本
 */
import { Module, Mutation, VuexModule } from 'vuex-module-decorators';

/**
 * 示例模块的store
 */
@Module({ name: 'token', namespaced: true })
export class TokenModule extends VuexModule {
  public token = '';

  get getToken() {
    return this.token;
  }

  @Mutation
  public setToken(token: string) {
    this.token = token;
  }

  @Mutation
  resetToken() {
    this.token = '';
  }
}
